package com.blog.mapper;

import com.blog.entity.Users;

import org.apache.ibatis.annotations.*;

/**
* @author 电脑小白
* @description 针对表【users】的数据库操作Mapper
* @createDate 2025-06-27 16:45:57
* @Entity com.blog.entity.Users
*/

public interface UsersMapper{

    @Select("select * from users where email=#{email}")
    Users findByEmail(String email);

    @Insert("insert into users (nickname,email,password,role,avatar,create_time) values(#{nickname},#{email},#{password},#{role},#{avatar},#{createTime})")
    void insertuser(Users users);

    @Update("update users set password=#{password} where email=#{email}")
    void updatePassword(@Param("password")String password,@Param("email") String email);
    @Select("select * from users where id=#{authorId}")
    Users findById(Integer authorId);
}




